'\" t
.\"     Title: modprobe
.\"    Author: Jon Masters <jcm@jonmasters.org>
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 03/05/2024
.\"    Manual: modprobe
.\"    Source: kmod
.\"  Language: English
.\"
.TH "MODPROBE" "8" "03/05/2024" "kmod" "modprobe"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
modprobe \- Add and remove modules from the Linux Kernel
.SH "SYNOPSIS"
.HP \w'\fBmodprobe\fR\ 'u
\fBmodprobe\fR [\fB\-v\fR] [\fB\-V\fR] [\fB\-C\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-n\fR] [\fB\-i\fR] [\fB\-q\fR] [\fB\-b\fR] [\fImodulename\fR] [\fB\fImodule\ parameters\fR\fR...]
.HP \w'\fBmodprobe\fR\ 'u
\fBmodprobe\fR [\-r] [\fB\-v\fR] [\fB\-n\fR] [\fB\-i\fR] [\fB\fImodulename\fR\fR...]
.HP \w'\fBmodprobe\fR\ 'u
\fBmodprobe\fR [\-c]
.HP \w'\fBmodprobe\fR\ 'u
\fBmodprobe\fR [\-\-dump\-modversions] [\fIfilename\fR]
.SH "DESCRIPTION"
.PP
\fBmodprobe\fR
intelligently adds or removes a module from the Linux kernel: note that for convenience, there is no difference between _ and \- in module names (automatic underscore conversion is performed)\&.
\fBmodprobe\fR
looks in the module directory
/lib/modules/`uname \-r`
for all the modules and other files, except for the optional configuration files in the
/etc/modprobe\&.d
directory (see
\fBmodprobe.d\fR(5))\&.
\fBmodprobe\fR
will also use module options specified on the kernel command line in the form of <module>\&.<option> and blacklists in the form of modprobe\&.blacklist=<module>\&.
.PP
Note that unlike in 2\&.4 series Linux kernels (which are not supported by this tool) this version of
\fBmodprobe\fR
does not do anything to the module itself: the work of resolving symbols and understanding parameters is done inside the kernel\&. So module failure is sometimes accompanied by a kernel message: see
\fBdmesg\fR(8)\&.
.PP
\fBmodprobe\fR
expects an up\-to\-date
modules\&.dep\&.bin
file as generated by the corresponding
\fBdepmod\fR
utility shipped along with
\fBmodprobe\fR
(see
\fBdepmod\fR(8))\&. This file lists what other modules each module needs (if any), and
\fBmodprobe\fR
uses this to add or remove these dependencies automatically\&.
.PP
If any arguments are given after the
\fImodulename\fR, they are passed to the kernel (in addition to any options listed in the configuration file)\&.
.PP
When loading modules,
\fImodulename\fR
can also be a path to the module\&. If the path is relative, it must explicitly start with "\&./"\&. Note that this may fail when using a path to a module with dependencies not matching the installed depmod database\&.
.SH "OPTIONS"
.PP
\fB\-a\fR, \fB\-\-all\fR
.RS 4
Insert all module names on the command line\&.
.RE
.PP
\fB\-b\fR, \fB\-\-use\-blacklist\fR
.RS 4
This option causes
\fBmodprobe\fR
to apply the
\fBblacklist\fR
commands in the configuration files (if any) to module names as well\&. It is usually used by
\fBudev\fR(7)\&.
.RE
.PP
\fB\-C\fR, \fB\-\-config\fR
.RS 4
This option overrides the default configuration directory (/etc/modprobe\&.d)\&.
.sp
This option is passed through
\fBinstall\fR
or
\fBremove\fR
commands to other
\fBmodprobe\fR
commands in the MODPROBE_OPTIONS environment variable\&.
.RE
.PP
\fB\-c\fR, \fB\-\-showconfig\fR
.RS 4
Dump out the effective configuration from the config directory and exit\&.
.RE
.PP
\fB\-\-dump\-modversions\fR
.RS 4
Print out a list of module versioning information required by a module\&. This option is commonly used by distributions in order to package up a Linux kernel module using module versioning deps\&.
.RE
.PP
\fB\-d\fR, \fB\-\-dirname\fR
.RS 4
Root directory for modules,
/
by default\&.
.RE
.PP
\fB\-\-first\-time\fR
.RS 4
Normally,
\fBmodprobe\fR
will succeed (and do nothing) if told to insert a module which is already present or to remove a module which isn\*(Aqt present\&. This is ideal for simple scripts; however, more complicated scripts often want to know whether
\fBmodprobe\fR
really did something: this option makes modprobe fail in the case that it actually didn\*(Aqt do anything\&.
.RE
.PP
\fB\-\-force\-vermagic\fR
.RS 4
Every module contains a small string containing important information, such as the kernel and compiler versions\&. If a module fails to load and the kernel complains that the "version magic" doesn\*(Aqt match, you can use this option to remove it\&. Naturally, this check is there for your protection, so using this option is dangerous unless you know what you\*(Aqre doing\&.
.sp
This applies to any modules inserted: both the module (or alias) on the command line and any modules on which it depends\&.
.RE
.PP
\fB\-\-force\-modversion\fR
.RS 4
When modules are compiled with CONFIG_MODVERSIONS set, a section detailing the versions of every interfaced used by (or supplied by) the module is created\&. If a module fails to load and the kernel complains that the module disagrees about a version of some interface, you can use "\-\-force\-modversion" to remove the version information altogether\&. Naturally, this check is there for your protection, so using this option is dangerous unless you know what you\*(Aqre doing\&.
.sp
This applies any modules inserted: both the module (or alias) on the command line and any modules on which it depends\&.
.RE
.PP
\fB\-f\fR, \fB\-\-force\fR
.RS 4
Try to strip any versioning information from the module which might otherwise stop it from loading: this is the same as using both
\fB\-\-force\-vermagic\fR
and
\fB\-\-force\-modversion\fR\&. Naturally, these checks are there for your protection, so using this option is dangerous unless you know what you are doing\&.
.sp
This applies to any modules inserted: both the module (or alias) on the command line and any modules it on which it depends\&.
.RE
.PP
\fB\-i\fR, \fB\-\-ignore\-install\fR, \fB\-\-ignore\-remove\fR
.RS 4
This option causes
\fBmodprobe\fR
to ignore
\fBinstall\fR
and
\fBremove\fR
commands in the configuration file (if any) for the module specified on the command line (any dependent modules are still subject to commands set for them in the configuration file)\&. Both
\fBinstall\fR
and
\fBremove\fR
commands will currently be ignored when this option is used regardless of whether the request was more specifically made with only one or other (and not both) of
\fB\-\-ignore\-install\fR
or
\fB\-\-ignore\-remove\fR\&. See
\fBmodprobe.d\fR(5)\&.
.RE
.PP
\fB\-n\fR, \fB\-\-dry\-run\fR, \fB\-\-show\fR
.RS 4
This option does everything but actually insert or delete the modules (or run the install or remove commands)\&. Combined with
\fB\-v\fR, it is useful for debugging problems\&. For historical reasons both
\fB\-\-dry\-run\fR
and
\fB\-\-show\fR
actually mean the same thing and are interchangeable\&.
.RE
.PP
\fB\-q\fR, \fB\-\-quiet\fR
.RS 4
With this flag,
\fBmodprobe\fR
won\*(Aqt print an error message if you try to remove or insert a module it can\*(Aqt find (and isn\*(Aqt an alias or
\fBinstall\fR/\fBremove\fR
command)\&. However, it will still return with a non\-zero exit status\&. The kernel uses this to opportunistically probe for modules which might exist using request_module\&.
.RE
.PP
\fB\-R\fR, \fB\-\-resolve\-alias\fR
.RS 4
Print all module names matching an alias\&. This can be useful for debugging module alias problems\&.
.RE
.PP
\fB\-r\fR, \fB\-\-remove\fR
.RS 4
This option causes
\fBmodprobe\fR
to remove rather than insert a module\&. If the modules it depends on are also unused,
\fBmodprobe\fR
will try to remove them too\&. Unlike insertion, more than one module can be specified on the command line (it does not make sense to specify module parameters when removing modules)\&.
.sp
There is usually no reason to remove modules, but some buggy modules require it\&. Your distribution kernel may not have been built to support removal of modules at all\&.
.RE
.PP
\fB\-w\fR, \fB\-\-wait=\fRTIMEOUT_MSEC
.RS 4
This option causes
\fBmodprobe \-r\fR
to continue trying to remove a module if it fails due to the module being busy, i\&.e\&. its refcount is not 0 at the time the call is made\&. Modprobe tries to remove the module with an incremental sleep time between each tentative up until the maximum wait time in milliseconds passed in this option\&.
.RE
.PP
\fB\-S\fR, \fB\-\-set\-version\fR
.RS 4
Set the kernel version, rather than using
\fBuname\fR(2)
to decide on the kernel version (which dictates where to find the modules)\&.
.RE
.PP
\fB\-\-show\-depends\fR
.RS 4
List the dependencies of a module (or alias), including the module itself\&. This produces a (possibly empty) set of module filenames, one per line, each starting with "insmod" and is typically used by distributions to determine which modules to include when generating initrd/initramfs images\&.
\fBInstall\fR
commands which apply are shown prefixed by "install"\&. It does not run any of the install commands\&. Note that
\fBmodinfo\fR(8)
can be used to extract dependencies of a module from the module itself, but knows nothing of aliases or install commands\&.
.RE
.PP
\fB\-s\fR, \fB\-\-syslog\fR
.RS 4
This option causes any error messages to go through the syslog mechanism (as LOG_DAEMON with level LOG_NOTICE) rather than to standard error\&. This is also automatically enabled when stderr is unavailable\&.
.sp
This option is passed through
\fBinstall\fR
or
\fBremove\fR
commands to other
\fBmodprobe\fR
commands in the MODPROBE_OPTIONS environment variable\&.
.RE
.PP
\fB\-V\fR, \fB\-\-version\fR
.RS 4
Show version of program and exit\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
Print messages about what the program is doing\&. Usually
\fBmodprobe\fR
only prints messages if something goes wrong\&.
.sp
This option is passed through
\fBinstall\fR
or
\fBremove\fR
commands to other
\fBmodprobe\fR
commands in the MODPROBE_OPTIONS environment variable\&.
.RE
.SH "ENVIRONMENT"
.PP
The MODPROBE_OPTIONS environment variable can also be used to pass arguments to
\fBmodprobe\fR\&.
.SH "COPYRIGHT"
.PP
This manual page originally Copyright 2002, Rusty Russell, IBM Corporation\&. Maintained by Jon Masters and others\&.
.SH "SEE ALSO"
.PP
\fBmodprobe.d\fR(5),
\fBinsmod\fR(8),
\fBrmmod\fR(8),
\fBlsmod\fR(8),
\fBmodinfo\fR(8)
\fBdepmod\fR(8)
.SH "AUTHORS"
.PP
\fBJon Masters\fR <\&jcm@jonmasters\&.org\&>
.RS 4
Developer
.RE
.PP
\fBRobby Workman\fR <\&rworkman@slackware\&.com\&>
.RS 4
Developer
.RE
.PP
\fBLucas De Marchi\fR <\&lucas\&.de\&.marchi@gmail\&.com\&>
.RS 4
Developer
.RE
